#ifndef ELEMENTXML__H
#define ELEMENTXML__H

#include "config.h"
#include "AttributeXML.h"
#include "NodeXML.h"

using namespace std;

/**
 *ElementXML represents XML Tag and store his content (attributes, datas and childs)
 */

class ElementXML:public NodeXML{

public:
ElementXML();
/**
 * Constructor n°1 : Instanciate the 4 members of this class: children, attributes, ns, name.
 * @param _children NULL if no children
 * @param _attributes NULL if no attributes
 * @param _ns the namespace of the attribute (char*), NULL if no namespace
 * @param _name the value of the attribute (char*)
 */
ElementXML(vector<NodeXML *> * _children, vector<AttributeXML *> * _attributes, char* _ns, char* _name/*, ElementXML * daddy*/);

/**
 * Constructor n°2 : Instanciate the 4 members of this class: children, attributes, ns, name.
 * @param _children NULL if no children
 * @param _attributes NULL if no attributes
 * @param _ns the namespace of the attribute (string), NULL if no namespace
 * @param _name the value of the attribute (string)
 */
ElementXML(vector<NodeXML *> * _children, vector<AttributeXML *> * _attributes, string _ns, string _name/*, ElementXML * daddy*/);

/**
 * Destructor
 */
virtual ~ElementXML(){};

/**
 * Setter for the class member: _attributes
 * @param _attributes the vector _attributes to set
 * @return true if no error, false otherwise
 */
bool setAttributes(vector<AttributeXML * > * _attributes);

/**
 * Setter for the class member: children
 * @param _attributes the vector _children to set
 * @return true if no error, false otherwise
 */
bool setChildren(vector<NodeXML * > * _children);

/**
 * Add an attribute to the class member vector: attributes
 * @param _at the attribute to add
 * @return true if no error, false otherwise
 */
bool addAttribute(AttributeXML * _at);

/**
 * Add a child to the class member vector: children
 * @param _child the child to add
 * @return true if no error, false otherwise
 */
bool addChild(NodeXML * _child);

/**
 * Getter for the class member: attributes
 *@return the class member : attributes
 */
vector<AttributeXML *> * getAttributes() const;

/**
 * Getter for the class member: children
 *@return the class member : children
 */
vector<NodeXML *> * getChildren() const;
//bool setDaddy(ElementXML * whosYourDaddy);
//ElementXML * getDaddy();

/**
 * Getter for the class member: name
 *@return the class member : name
 */
string  getName() const;

/**
 * Setter for the class member: name
 * @param _attributes Set the class member : name
 * @return true if no error, false otherwise
 */
bool setName(string  _name);

/**
 * Getter for the class member: name
 *@return the class member : name
 */
string getNameSpace() const;

/**
 * Setter for the class member: ns
 * @param _attributes Set the class member : ns
 * @return true if no error, false otherwise
 */
bool setNameSpace(string _ns);

/**
 * Method which returns the representation in string of an Element and all his children string representation
 * @return String representation of this element and his children
 */
string toString() const;

string getRegExpChildren() const;
string getRegExp() const;

protected:

/**
 * A protected class member contain the children of this Element
 */
vector<NodeXML *> * children;

/**
 * A protected class member contain the attributes of this Element
 */
vector<AttributeXML *> * attributes;

/**
 * A protected class member represent the name of the Xml attribute
 */
string name;

/**
 * A protected class member represent the namespace
 */
string ns;
//ElementXML * daddy;

};

#endif
